{* show page 'links exchange' *}
<h1>{$smarty.const.STRING_MODULES_LINKEXCHANGE}</h1>
<table width="100%">
	<tr>
		<td>
		[ <a href="index.php?links_exchange=yes">{$smarty.const.ADMIN_LE_ALL_CATEGORIES}</a> ]
		</td>
		<td align="right">
		[ <a href="#add_link">{$smarty.const.STRING_LE_ADD_LINK}</a> ]
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<div class="divider_grey"></div>
			<div class="subheader">{$smarty.const.STRING_LE_CATEGORIES}</div>
		</td>
	</tr>
	<tr>
		<td valign="top" style="line-height:1.5;">
		 {section name=i max=$le_categories_pr loop=$le_categories}
			{if $le_categories[i].le_cID!=$le_CategoryID}<a href="{"msg=&page=1&le_categoryID=`$le_categories[i].le_cID`"|set_query}">{$le_categories[i].le_cName}</a>
			{else}
				{assign var="le_CategoryName" value=$le_categories[i].le_cName}
				{$le_categories[i].le_cName}
			{/if}
			<br />
		 {/section}
		</td>
		<td valign="top" style="line-height:1.5;">
		 {section name=i start=$le_categories_pr loop=$le_categories}
			{if $le_categories[i].le_cID!=$le_CategoryID}<a href="{"msg=&page=1&le_categoryID=`$le_categories[i].le_cID`"|set_query}">{$le_categories[i].le_cName}</a>
			{else}
				{assign var="le_CategoryName" value=$le_categories[i].le_cName}
				{$le_categories[i].le_cName}
			{/if}
			<br />
		 {/section}
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<div class="divider_grey"></div>
			<div class="subheader">{$smarty.const.STRING_LE_LINKS}</div>
		</td>
	</tr>
	<tr>
		<td colspan="2" style="line-height:1.5;">
		{foreach from=$le_links item=_le_link}
			<a href="{$_le_link.le_lURL}">{$_le_link.le_lText}</a><br />
		{/foreach}
		{if $last_page>1}
		<br />
			{if $curr_page>1}
				&nbsp; <a class="no_underline" href ="{"page=`$curr_page-1`&show_all="|set_query}">&lt;&lt; {$smarty.const.STRING_PREVIOUS}</a>
			{/if}
			{foreach from=$le_lister_range item=_page}
				&nbsp; {if $_page!=$curr_page or $showAllLinks}<a class="no_underline" href="{"page=`$_page`&show_all="|set_query}">{$_page}</a> {else}{$_page}{/if}
			{/foreach}
			{if $curr_page<$last_page}
				&nbsp; <a class="no_underline" href ="{"page=`$curr_page+1`&show_all="|set_query}">{$smarty.const.STRING_NEXT} &gt;&gt;</a>
			{/if}
			&nbsp; |&nbsp; {if $showAllLinks}{$smarty.const.STRING_SHOWALL}{else}<a class="no_underline" href ="{"show_all=yes"|set_query}">{$smarty.const.STRING_SHOWALL}</a>{/if}
		{/if}
		</td>
	</tr>
	<tr>
		<td colspan="2">
		<div class="divider_grey"></div>
		<a name="add_link"></a>
		<div class="subheader">{$smarty.const.STRING_LE_ADD_LINK}</div>
		{if $error}<div class="error_msg_f">{$error}</div>{/if}
		{if $error_ok}<div class="ok_msg_f">{$error_ok}</div>{/if}
		<form action="{$REQUEST_URI}" method="POST">
		<input name="fACTION" value="ADD_LINK" type="hidden" />
		<input name="fREDIRECT" value="{$REQUEST_URI}" type="hidden" />
		{$smarty.const.ADMIN_LE_LINK_CATEGORY}:
		<br />
			<select name="LINK[le_lCategoryID]">
			<option value="0">{$smarty.const.ADMIN_NOT_DEFINED}</option>
			{foreach from=$le_categories item=_category}
				<option value="{$_category.le_cID}" 
					{if $le_CategoryID==$_category.le_cID} selected="selected"
					{elseif $pst_LINK.le_lCategoryID==$_category.le_cID} selected="selected"
					{/if}
					>{$_category.le_cName}</option>
			{/foreach}
			</select>
			<br />
		{$smarty.const.ADMIN_LE_LINK_URL}:
		<br />
		<input name="LINK[le_lURL]" value="{if $pst_LINK.le_lURL}{$pst_LINK.le_lURL}{else}http://{/if}" size="60" type="text" />
		<br />
		{$smarty.const.ADMIN_LE_LINK_TEXT}:
		<br />
		<input name="LINK[le_lText]" value="{$pst_LINK.le_lText}" size="60" type="text" />
		<br />
		<br />
		<input value="{$smarty.const.ADD_BUTTON}" type="submit" />
		</form>
		</td>
	</tr>
</table>